<script setup>
  import Tarbar from "@/components/Tarbar.vue"
  import { watch, ref } from "vue"
  import { useRoute } from "vue-router"
  //监听地址变化 判断路由中定义的isShowNav是否显示底部导航
  const route = useRoute()
  const isShowNav = ref(false)
  watch(
    route,
    newVal => {
      isShowNav.value = newVal.meta.isShowNav
    },
    {
      immediate: true,
    }
  )
</script>

<template>
  <div>
    <router-view />
    <Tarbar v-if="isShowNav" />
  </div>
</template>

<style scoped></style>
